﻿#region Information
/*
 * Author: gkhtdl63
 * Email: ldthao0949@gmail.com
 * Phone: +84 949 749 129  +84 914 941 229
 * ---------------------------
 * Create: 20/06/2014
 * Update: 20/06/2014
 * Status: OK
 */
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;

namespace EXT
{
    public class GoiMail
    {
        /// <summary>
        /// Gởi mai
        /// </summary>
        /// <param name="tu">người gởi</param>
        /// <param name="toi">gởi đến</param>
        /// <param name="chude">Chủ đề</param>
        /// <param name="noidung">Nội dung</param>
        /// <param name="pass">pass người gởi</param>
        public void GoiMail_(string tu, string toi, string chude, string noidung, string pass)
        {
            MailMessage mail = new MailMessage(tu, toi, chude, noidung);
            SmtpClient client = new SmtpClient("smtp.gmail.com ");
            client.Port = 587;
            client.Credentials = new System.Net.NetworkCredential(tu, pass);
            client.EnableSsl = true;
            client.Send(mail);
        }
    }
}
